/*
 * Copyright © 2011 SenseForce.com.
 * The Software shall be used for Good, not Evil.
 */

package com.senseforce.midlets;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import com.senseforce.classes.CartoonClockCanvas;

/**
 * @author jcccn
 * @site http://www.senseforce.com/
 */
public class CartoonClock extends MIDlet implements CommandListener {

	private Display display;
	private Command exitCommand = new Command("Exit", Command.EXIT, 0);
	
	private CartoonClockCanvas canvas;
	
    public void startApp() {
		display = Display.getDisplay(this);
		canvas = new CartoonClockCanvas();
		display.setCurrent(canvas);
		canvas.setCommandListener(this);
		canvas.addCommand(exitCommand);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
	
	public void commandAction(Command c, Displayable d) {
		if (c == exitCommand) {
			try {
				destroyApp(true);
			} catch(Exception ex) {
				
			}
			notifyDestroyed();
		}
	}
}
